<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateRanksTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('ranks', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('title', 30);
            $table->integer('min_point')->comment('该等级的最低积分');
            $table->integer('max_point')->comment('该等级的最高积分');
            $table->tinyInteger('discount')->default(100)
                ->comment('该会员等级的商品折扣，7.8折，这里为78');
            $table->tinyInteger('show_price')->default(0)
                ->comment('是否在不是该等级会员购买页面显示该会员等级的折扣价格.1,显示;0,不显示');
            $table->tinyInteger('if_special')->default(0)
                ->comment('是否事特殊会员等级.0,不是;1,是');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('ranks');
    }
}
